macos: support mix-rate monitors
authorChristian Hergert <christian@hergert.me>
Mon, 28 Feb 2022 07:31:28 +0000 (23:31 -0800)
committerChristian Hergert <chergert@redhat.com>
Wed, 16 Mar 2022 19:24:11 +0000 (12:24 -0700)
commit856728ea1074457a426c3cc9224800551849360e
treef300d88436ac9a07acbdf04b1f6460c9794dfe91
parentdf2fb3b5209dcb0740a0af6d8fde5b490e310169
macos: support mix-rate monitors

Previously, a single CVDisplayLink was used to drive updates for all
surfaces across all monitors. It used a 'best guess' rate which would
allow for updates across monitors of mixed rates. This is undesirable for
situations where you might have a 144hz monitor as it does not allow for
reaching up to that frame rate.

Instead, we want to use a per-monitor CVDisplayLink which will fire at the
rate of the monitor down to the level of updates we require. This commit
does just that.

When a surface crosses onto a new monitor, that monitor is used to drive
the GdkFrameClock.

Fixes #4732
gdk/macos/gdkmacosdisplay-private.h
gdk/macos/gdkmacosdisplay.c
gdk/macos/gdkmacosmonitor-private.h
gdk/macos/gdkmacosmonitor.c
gdk/macos/gdkmacossurface-private.h
gdk/macos/gdkmacossurface.c